<?php
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/logic/CustomCommand.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/factory/DaoFactory.php';
	require_once $_SERVER['DOCUMENT_ROOT'] . '/SAGER/model/entity/ResourcesRequest.php';
	
	/*
	* Class to create a resources request
	*/
	class CommandCreateResourcesRequest extends CustomCommand {
		/*
		* Constructor of the class
		*/
		public function __construct($date, $username) {
			$this -> resourcesRequest = new ResourcesRequest($date, $username);
		}
		
		/*
		* Method to execute to create a resources request
		*/
		public function execute() {
			$daoFactory = DaoFactory :: getMySqlDaoFactory();
			$irrad = $daoFactory -> getMySqlResourcesRequestAccessDao();			
			$resourcesRequestCreation = $irrad -> createResourcesRequest
				($this -> resourcesRequest);
				
			$GLOBALS['debug'] -> log($resourcesRequestCreation, "resourcesRequestCreation");
	
			$this -> result = $resourcesRequestCreation;
		}
	}
?>